home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
ddj0897.zip
/
DYN401.ZIP
/
class
/
linkobj.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-04-16
|
4KB
|
181 lines
/* Copyright (c) 1993-1996 Algorithms Corporation */
/* All rights reserved. */
/* This file automatically generated by dpp - do not edit */
#define DPP_STRATEGY 2
#define DPP_FASTWIDE 0
#define CLASS LinkObject_c
#define ivType LinkObject_iv_t
#include "generics.h"
object LinkObject_c;
#line 19 "linkobj.d"
#define FIRST gNext
#define LAST gPrevious
cvmeth objrtn LinkObject_cvm_vMakeList(object self, va_list _rest_)
{
object lst, obj;
MAKE_REST(self);
lst = gNew(self);
while (obj = GetArg(object))
gAddBefore(lst, gNewWithObj(LinkValue, obj));
return lst;
}
#line 41 "linkobj.c"
static objrtn LinkObject_cfm_vMakeList(object self, ...)
{
va_list _rest_;
va_start(_rest_, self);
return LinkObject_cvm_vMakeList(self, _rest_);
}
#line 33 "linkobj.d"
ivmeth objrtn LinkObject_ivm_vGetValues(object self, va_list _rest_)
{
object *var, seq, obj;
MAKE_REST(self);
seq = gSequence(self);
obj = gNext(seq);
while (var = GetArg(object *)) {
*var = obj;
if (obj)
obj = gNext(seq);
}
if (obj)
gDispose(seq);
return self;
}
#line 70 "linkobj.c"
static objrtn LinkObject_ifm_vGetValues(object self, ...)
{
va_list _rest_;
va_start(_rest_, self);
return LinkObject_ivm_vGetValues(self, _rest_);
}
#line 50 "linkobj.d"
imeth objrtn LinkObject_im_gAddFirst(object self, object obj)
{
object lnk;
ChkArgNul(obj, 2);
lnk = gNewWithObj(LinkValue, obj);
gAddAfter(self, lnk);
return self;
}
imeth objrtn LinkObject_im_gFirst(object self)
{
object lnk = FIRST(self);
return lnk ? gValue(lnk) : NULLOBJ;
}
imeth objrtn LinkObject_im_gAddLast(object self, object obj)
{
object lnk;
ChkArgNul(obj, 2);
lnk = gNewWithObj(LinkValue, obj);
gAddBefore(self, lnk);
return self;
}
imeth objrtn LinkObject_im_gLast(object self)
{
object lnk = LAST(self);
return lnk ? gValue(lnk) : NULLOBJ;
}
imeth objrtn LinkObject_im_gSequence(object self)
{
return gNewWithObj(LinkObjectSequence, FIRST(self));
}
imeth objrtn LinkObject_im_gSequenceLinks(object self)
{
return gNewWithObj(LinkSequence, FIRST(self));
}
imeth objrtn LinkObject_im_gNth(object self, int idx)
{
object r = oSuper(LinkObject_c, gNth, self)(self, idx);
return r ? gValue(r) : NULLOBJ;
}
#line 135 "linkobj.c"
objrtn LinkObject_initialize(void)
{
static CRITICALSECTION cs;
static int volatile once = 0;
ENTERCRITICALSECTION(_CI_CS_);
if (!once) {
INITIALIZECRITICALSECTION(cs);
once = 1;
}
LEAVECRITICALSECTION(_CI_CS_);
ENTERCRITICALSECTION(cs);
if (LinkObject_c) {
LEAVECRITICALSECTION(cs);
return LinkObject_c;
}
INHIBIT_THREADER;
LinkList_initialize();
if (LinkObject_c) {
ENABLE_THREADER;
LEAVECRITICALSECTION(cs);
return LinkObject_c;
}
LinkObject_c = gNewClass(Class, "LinkObject", 0, 0, LinkList, END);
cvMethodFor(LinkObject, vMakeList, LinkObject_cvm_vMakeList, LinkObject_cfm_vMakeList);
iMethodFor(LinkObject, gAddFirst, LinkObject_im_gAddFirst);
iMethodFor(LinkObject, gFirst, LinkObject_im_gFirst);
iMethodFor(LinkObject, gLast, LinkObject_im_gLast);
iMethodFor(LinkObject, gSequence, LinkObject_im_gSequence);
ivMethodFor(LinkObject, vGetValues, LinkObject_ivm_vGetValues, LinkObject_ifm_vGetValues);
iMethodFor(LinkObject, gSequenceLinks, LinkObject_im_gSequenceLinks);
iMethodFor(LinkObject, gAddLast, LinkObject_im_gAddLast);
iMethodFor(LinkObject, gNth, LinkObject_im_gNth);
ENABLE_THREADER;
LEAVECRITICALSECTION(cs);
return LinkObject_c;
}